﻿using System;
using System.Windows.Data;
using System.Windows.Media.Imaging;

namespace SUMO.MediaBrowser.Foundation
{
    public class UrlImageSourceConverter : IValueConverter
    {
        #region IValueConverter

        public object Convert(object value, Type targetType,
                              object parameter, System.Globalization.CultureInfo culture)
        {
            string path = (string)value;
            BitmapImage result = new BitmapImage(new Uri(path, UriKind.RelativeOrAbsolute));
            return result;

        }

        public object ConvertBack(object value, Type targetType,
                                  object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}